import * as client from './client'
import urlConfig from './urlConfig'
///获取门店信息
/**
 * 请求参数
 */
export class ProductListRst {

    public salesOutletUID: string;  //门店uid
    public returnFields: string[];  //返回的字段列表
    public productStatus: number;   // 商品状态(3:上架 4:下架 不填获取上下架商品)
    public pageIndex: number;
    public pageSize: number;
}
/**
 * 返回数据
 */
export class ProductListRpn {
    pageInfo: pageInfo;
    list: product[];
}

export class pageInfo{
    public totalCount: number;
    public pageCount: number;
}

export class product{
    public id: number;
    public productUID: string;
    public name: string;
    public supplyPrice: number;
    public productPictures: string;
}
/**
 * 获取数据
 * @param rst 参数
 */
export async function exec(rst: ProductListRst) {
    const data = await client.exec(urlConfig.productList, rst);
    return JSON.parse(data) as client.RSM<ProductListRpn>;
}
